package com.mszlu.blog.dao.mongodb;

import com.mszlu.blog.entity.mongo.MongoComment;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;

import java.util.List;

public interface MongoCommentDAO extends MongoRepository<MongoComment,String> {
    @Query(value = "{'articleId':?0,'level':?1}",fields = "{}")
    public List<MongoComment> findByArticleIdaAndLevel(Long articleId, Integer level);

    @Query(value = "{'parentId':?0,'level':?1}",fields = "{}")
    public List<MongoComment> findByParentIdAndLevel(String parentId, Integer level);
}
